package com.jiyinit.web.core.business.dao;

import com.jiyinit.core.framework.dao.mybatis.base.MybatisDaoContext;
import com.jiyinit.web.core.business.entity.TabCoreNoticeEntity;
import com.jiyinit.web.core.business.entity.TabUserNoticeEntity;
import com.jiyinit.web.core.business.vo.NoticeUserVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p></p>
 * <p/>
 * <PRE>
 * <BR>	修改记录
 * <BR>-----------------------------------------------
 * <BR>	修改日期			修改人			修改内容
 * </PRE>
 *
 * @author changly
 * @version 1.0
 * @date 2017/12/29 17:51
 * @since 1.0
 */
@Repository("core.tabUserNoticeDao")
public class TabUserNoticeDao {

    /**
     * 日志对象
     */
    private static Logger logger = LoggerFactory.getLogger(TabUserNoticeDao.class);

    private String SQLID = "core.tabUserNotice.";

    @Autowired
    @Qualifier("core.MybatisDaoContext")
    private MybatisDaoContext mybatisDaoContext;

    public int add(List<TabUserNoticeEntity> list){
        return mybatisDaoContext.batchSave(SQLID+"insertSelective",list);
    }

    public List<NoticeUserVo> findAlloterById(Integer id){
        return mybatisDaoContext.findAll(SQLID + "findAlloterById", NoticeUserVo.class, id);
    }

}
